package muilty_thread.pic_java_design_pattern.Immutable;

/**
 * @version: 1.0
 * @Description: TODO
 * @author: zZmH
 * @date: 2020/09/24 20:25
 */


public class PrintPersonThread extends Thread {
    private Person person;

    public PrintPersonThread(Person person) {
        this.person = person;
    }

    @Override
    public void run() {
        while(true){
            System.out.println(Thread.currentThread().getName() + "params:" + person.getName());

        }

    }

    public static void main(String[] args) {
        Person sb = new Person("sb", "123 number_th");
        new PrintPersonThread(sb).start();
        new PrintPersonThread(sb).start();
        new PrintPersonThread(sb).start();
    }
}
